{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post" enctype="">
            <div class="layui-form-item">
                <label class="layui-form-label">供应商</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入名称" lay-verify="required|name" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系人</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="text" name="user_name" value="{$data.user_name|default=''}" autocomplete="off" placeholder="请输入联系人" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系方式</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="text" name="mobile" value="{$data.mobile|default=''}" autocomplete="off" placeholder="请输入联系方式" lay-verify="required|number" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="text" name="address" value="{$data.address|default=''}" autocomplete="off" placeholder="请输入联系地址" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">开户行</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <select name="bank_id" lay-verify="required">
                        <option value="">请选择银行</option>
                        {volist name="bank" id="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.bank_id eq $v.id"}selected{/if}>{$v.name}</option>
                        {/volist}
                      </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">银行卡号</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="text" name="bank_num" value="{$data.bank_num|default=''}" autocomplete="off" placeholder="请输入银行卡号" lay-verify="required|number" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">营业执照</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <img class="layui-upload-img" id="test-upload-normal-img" src="{$data.img|default='__AD_IMG__/business_license.png'}" width="50" height="50">
                    <input type="hidden" name="img" value="{$data.img|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    <button type="button" class="layui-btn ajax-avatar">上传</button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block" style="max-width: 600px;">
                    <input type="hidden" name="status" value="0">
                    <input type="checkbox" name="status" value="1" lay-skin="switch" lay-text="启用|禁用" {if isset($data.status) and $data.status eq '1'}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="max-width: 600px;">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
